package com.ruoyi.system.service.impl;

import com.ruoyi.system.domain.OaNote;
import com.ruoyi.system.mapper.OaNoteMapper;
import com.ruoyi.system.service.IOaNoteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 便签服务实现类
 *
 * @author 自定义
 * @date 2025-04-15
 */
@Service
public class OaNoteServiceImpl implements IOaNoteService {

    @Autowired
    private OaNoteMapper oaNoteMapper;

    @Override
    public OaNote selectOaNoteById(Long id) {
        return oaNoteMapper.selectOaNoteById(id);
    }

    @Override
    public List<OaNote> selectOaNoteList(OaNote oaNote) {
        return oaNoteMapper.selectOaNoteList(oaNote);
    }

    @Override
    public int insertOaNote(OaNote oaNote) {
        int rows = oaNoteMapper.insertOaNote(oaNote);
        System.out.println("插入后便签的 id: " + oaNote.getId());
        return rows;
    }

    @Override
    public int updateOaNote(OaNote oaNote) {
        return oaNoteMapper.updateOaNote(oaNote);
    }

    @Override
    public int deleteOaNoteById(Long id) {
        return oaNoteMapper.deleteOaNoteById(id);
    }

    @Override
    public int deleteOaNoteByIds(Long[] ids) {
        return oaNoteMapper.deleteOaNoteByIds(ids);
    }

    @Override
    public List<OaNote> selectOaNoteListByUserId(Long userId) {
        return oaNoteMapper.selectOaNoteListByUserId(userId);
    }
}